package com.example.demo.Logger;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/p1")
public class LoggerController {

    private static Logger logger = LoggerFactory.getLogger(LoggerController.class);

    @RequestMapping("/logger")
    public String v1(){
        logger.info("-----------要输出的日志内容---------- ");
        return "打印日志";
    }
    @RequestMapping("v2")
    public String v2(){
        logger.trace("-----------trace---------- ");
        logger.info("-----------info---------- ");
        logger.debug("-----------debug---------- ");
        logger.warn("-----------warn---------- ");
        logger.error("-----------error---------- ");
        return "打印不同日志级别";

    }
}
